home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / Other Langs / PowerLisp 1.01 / Library / stdlib.lisp < prev   
Encoding:
Text File  |  1993-08-27  |  1.2 KB  |  66 lines  |  [TEXT/ROSA]

  1. ;
  2. ;        Copyright © 1993 Roger Corman. All rights reserved.
  3. ;
  4.  
  5. ;
  6. ;        Lisp standard functions and macros to be loaded at startup.
  7. ;
  8.  
  9. (defun copyright ()
  10.     "Copyright © 1993 Roger Corman")
  11.  
  12. (print (copyright))
  13. (print "Loading PowerLisp standard library...")
  14.  
  15. (make-package :compiler)
  16.  
  17. (print "this is a test")    
  18.  
  19. ;; this is only needed to load the standard library,
  20. ;; which then rolls this functionality into 'load'.
  21. (defun load-binary (filename)
  22.     (let*
  23.         ((loaded 0)
  24.          (stream (open filename))
  25.          (*package* *package*)            ;; bind these to themselves
  26.          (*readtable* *readtable*)
  27.          (*standard-output* *standard-output*))
  28.          
  29.         (do* ((expr t))
  30.             ((null expr)(close stream) loaded)
  31.             (setq expr (%read-code-from-stream stream))
  32.             (if expr
  33.                 (progn
  34.                     (setq expr (funcall expr))
  35.                     (setq loaded (+ 1 loaded)))))))
  36.  
  37. (if (probe-file ":library:cl.compiled-lisp")
  38.     (progn 
  39.         (load-binary ":library:cl.compiled-lisp")
  40.         (print "Standard Library (binary) loaded."))
  41.     (if (probe-file ":library:cl.lisp")
  42.         (progn
  43.             (load ":library:cl.lisp")
  44.             (print "Standard Library loaded."))
  45.         (print "Could not find Standard Library.")))
  46.  
  47. (print "this is another test")    
  48. (setq *prompt* #'prompt)
  49.  
  50. ; garbage collect
  51. ;(gc)
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.